feat: Expand variables as empty in alert queries - #2910
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Greptile SummaryThe PR makes dashboard-tile alerts evaluate declared variables using empty selections and aligns alert previews and editor messaging with that behavior.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/api/src/tasks/checkAlerts/index.ts | Adds empty dashboard-variable declarations to raw-SQL and builder tile alert configurations. |
| packages/app/src/components/alerts/AlertDetailChart.tsx | Aligns alert-detail previews with scheduled execution by supplying empty variable selections. |
| packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx | Computes variable-reference warnings for alert-enabled chart configurations. |
| packages/common-utils/src/filters.ts | Extracts dashboard variable declaration construction into a shared helper while preserving valid-filter behavior. |
| packages/common-utils/src/variables.ts | Adds shared alert-warning text based on variables referenced by a chart configuration. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Filters[Dashboard variable declarations] --> Empty[Attach empty selections]
Empty --> Task[Scheduled alert query]
Empty --> Detail[Alert detail preview]
Empty --> Editor[Chart editor preview]
Editor --> Warning[Variable empty-state warning]
Task --> Query[Shared chart query rendering]
Detail --> Query
Editor --> Query
Reviews (6): Last reviewed commit: "chore: Update rachet" | Re-trigger Greptile
E2E Test Results✅ All tests passed • 300 passed • 1 skipped • 1167s
Tests ran across 4 shards in parallel. |
f89980d to
c0e271a
Compare
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Additional context: touches background tasks or the delivery pipeline lightly (11 lines, under the 30-line bar for Tier 4) Review process: Full human review — logic, architecture, edge cases. Stats
|
Deep Review✅ No critical issues found. The refactor extracting 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (6): correctness, reliability, adversarial, kieran-typescript, testing, maintainability. Testing gaps:
|
The merge-base changed after approval.
fae0abd to
988024b
Compare
988024b to
3b5176a
Compare
Summary
This PR extends the dashboard variable functionality to support substitution in alerts.
Screenshots or video
Empty variable state in alert previews
Empty states substituted in execution
Warning
How to test locally
NEXT_PUBLIC_ENABLE_DASHBOARD_VARIABLES=trueReferences